﻿// -----------------------------------------------------------------------
// <copyright file="WebRequestState.cs" company="TaskyMedia LLC">
// Copyright (c) TaskyMedia LLC
// </copyright>
// -----------------------------------------------------------------------

namespace SohpClient
{
    using System;
    using System.Net;

    /// <summary>
    /// Contains the state of a web request when used with asynchronous operations.
    /// </summary>
    internal class WebRequestState
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WebRequestState"/> class.
        /// </summary>
        /// <param name="request">The <see cref="HttpWebRequest"/> instance.</param>
        /// <param name="asyncState">The user-provided asynchronous state object.</param>
        public WebRequestState(HttpWebRequest request, object asyncState)
        {
            this.Request = request;
            this.AsyncState = asyncState;
        }

        /// <summary>
        /// Gets the <see cref="HttpWebRequest"/> instance.
        /// </summary>
        public HttpWebRequest Request
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the user-provided asynchronous state object.
        /// </summary>
        /// <value>
        /// The user-provided asynchronous state object.
        /// </value>
        public object AsyncState
        {
            get;
            private set;
        }
    }
}
